Skip to content

feat: add ckan source plugin#73

Merged
Gabrymi93 merged 4 commits intomainfrom
feat/ckan-hardening
Mar 31, 2026
Merged

feat: add ckan source plugin#73
Gabrymi93 merged 4 commits intomainfrom
feat/ckan-hardening

Conversation

@Gabrymi93
Copy link
Copy Markdown
Member

@Gabrymi93 Gabrymi93 commented Mar 28, 2026

Sintesi

Aggiunge il plugin CkanSource per il download di risorse da portali CKAN tramite risoluzione dinamica UUID.

Closes #70

Cosa cambia

  • toolkit/plugins/ckan.py - nuovo plugin con:
    • risoluzione tramite resource_show?id={resource_id}
    • fallback automatico a package_show se resource_show fallisce (404 o no URL)
    • protocol enforcer: http:// -> https:// sull'URL finale del file
    • retry loop su metadata e download
    • scoring risorse nel fallback (CSV > ZIP > XLSX > JSON > XML)
  • toolkit/core/registry.py - entry ckan nei plugin built-in
  • toolkit/raw/run.py - integrazione nel flusso run_raw con ext inference dall'URL risolto
  • toolkit/plugins/__init__.py - docstring aggiornata
  • docs/config-schema.md - schema aggiornato
  • tests/test_ckan_plugin.py - test unitari: https forcing, fallback package_show, errore senza identificatore
  • tests/test_raw_ext_inference.py - test inferenza estensione per tipo ckan
  • tests/test_registry.py - verifica registrazione plugin

Verifiche

  • pytest mirato: 16 passed
  • Smoke reale su OpenBDAP (resource_id=33344, dataset_id=d598ebd9-...): download ok, 7.9 MB, URL https risolto correttamente

Note

La sintassi dataset.yml da usare con questo plugin:

sources:
  - name: saldi_storico
    type: ckan
    args:
      portal_url: https://bdap-opendata.mef.gov.it
      resource_id: "33344"
      dataset_id: "d598ebd9-949d-4214-bb33-cd9c1be08f15"

dataset_id e' opzionale - serve solo per il fallback a package_show.

@Gabrymi93 Gabrymi93 requested a review from matteocavo March 29, 2026 08:38
@Gabrymi93
Copy link
Copy Markdown
Member Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b6bb2fd65

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Gabrymi93 Gabrymi93 merged commit 63aabfb into main Mar 31, 2026
5 checks passed
@Gabrymi93 Gabrymi93 deleted the feat/ckan-hardening branch March 31, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: harden CKAN source with resource_show resolution and https enforcement

1 participant